<meta charset="utf-8" />
<script>
var riqi=prompt("请输入一个日期（格式如:月日****年：");
var ri=riqi.indexOf("日")+1;
var nian=riqi.substring(ri);
var yueri=riqi.substring(0,ri);
var result=nian+yueri;
document.write("正确格式为"+result);
</script>    


